/*
 * @Author: yanjikun
 * @Date: 2022-03-23 16:49:39
 * @LastEditors: yanjikun
 * @LastEditTime: 2022-03-23 17:03:49
 * @Description: file content
 */

import type { BasicFormType } from '.'
import { inject, provide } from 'vue'

const key = Symbol('schema-form')
export const createFormContext = async (instance: BasicFormType) => {
  provide(key, instance)
}

export const useFormContext = () => {
  return inject(key) as BasicFormType
}
